﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MiniCrawler.Business;

namespace MiniCrawler.Logging
{
    public class Log
    {
        public static void WriteCurrent(string s)
        {
            for (int i = 0; i < 100; ++i)
            {
                Console.Write("\r{0}%   ","");
            }
            Console.Write("\r{0}%   ", s);
        }
        public static void WriteLog(string s)
        {
            
            Console.Write("[" + DateTime.Now.ToString("hh:mm:ss") + "]"  +  s + "\r\n");
            //LogService.Service.Info("[" + DateTime.Now.ToString("hh:mm:ss dd") + "]" + s + "\r\n");
        }
        public static void WriteCurrentLog(string message)
        {
            string m = message + " at " + DateTime.Now.ToString("hh:mm:ss dd-MM-yyyy") + "\r\n";
            WriteLog(m);
        }

        public static void WriteElapseTime(DateTime start)
        {
            TimeSpan x = DateTime.Now - start;
            string s = "[ELAPSED TIME][ " + DateTime.Now.ToString("hh:mm:ss") +"-" + start.ToString("hh:mm:ss") + " : " + (x.TotalSeconds) + " sec(s)]";
            WriteLog(s);
        }
    }
}
